package com.imooc.socialecom.base;

import lombok.Data;

@Data
public class JsonReturnType {

    private String status;

    private Object data;

    public static JsonReturnType createType(Object model) {
        JsonReturnType returnType = new JsonReturnType();
        returnType.setData(model);
        returnType.setStatus("success");
        return returnType;
    }

    public static JsonReturnType createErrorType(String errMsg) {
        JsonReturnType returnType = new JsonReturnType();
        returnType.setData(errMsg);
        returnType.setStatus("fail");
        return returnType;
    }

}
